<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"     
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./template/template_1.xhtml">

   
    <ui:define name="content">
        <div>
                <h:form>
                    <p:dataTable value="#{userManagedBean.usersPl}" var="item" 
                                 emptyMessage="No playlist found with given criteria"
                                 widgetVar="playlistTable" 
                                 paginator="true"  
                                 rows="20">
                        <p:column sortBy="#{item.name}"
                                  filterBy="#{item.name}"  
                                  filterMatchMode="contains">
                            <f:facet name="header">
                                <h:outputText value="Nom Playlist"/>
                            </f:facet>
                            <h:commandLink action="#{userManagedBean.showListeLectureDetails(item)}" value="#{item.name}"/>
                        </p:column>
                        <p:column>
                            <h:commandLink action="#{userManagedBean.loadPlaylist(item)}" value="modifier"/> 
                        </p:column>
                        <p:column>
                            <h:commandLink action="#{userManagedBean.removePlaylist(item)}" value="supprimer ( attention irreversible !!)"/> 
                        </p:column>


                    </p:dataTable>

                </h:form>

                <!-- TODO ne marche pas pour le moment
                <p:button  outcome="PlayerPlaylist" image="resources/img/Play.png" value="play" title="ecouter la playlist">  
                    <f:param name="productId" value="20" />  
                </p:button>
                 -->

            </div>
    </ui:define>

</ui:composition>
